Focus detection apparatus and focus detection method

ABSTRACT

A focus detection apparatus includes an imaging element includes that a plurality of focus detection pixels, a correction value calculation unit that calculates a correction value used to correct pixel signals based on an optical state before the imaging element performs imaging for still image capturing or imaging for focus detection, a correction unit that performs correction using the correction value simultaneously with reading the pixel signals from the focus detection pixels subsequent to the imaging for the still image capturing or the imaging for the focus detection by the imaging element, and a focus detection unit that performs focus detection based on the corrected pixel signals.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority fromthe prior Japanese Patent Application No. 2016-248389, filed Dec. 21,2016, the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a focus detection apparatus and a focusdetection method.

2. Description of the Related Art

An imaging device (focus detection apparatus) that detects a focus stateusing some of the pixels of an imaging element as focus detectionelements is known. Such a focus detection apparatus configures certainpixels of an imaging element as focus detection pixels, forms an imageon the focus detection pixels from subject light fluxes that have passedthrough different pupil areas symmetrical with respect to the center ofthe optical axis of an imaging optical system, and detects a phasedifference between the subject light fluxes to thereby detect a focusstate of the imaging optical system.

In an imaging apparatus, it is known that the amount of light fluxesincident through an imaging optical system decreases as the distancefrom the optical axis of the imaging optical system increases, by virtueof optical characteristics of the imaging optical system. This causesunevenness in illuminance of a subject image formed on an imagingelement. The focus adjustment apparatus disclosed in Jpn. Pat. Appln.KOKAI Publication No. 2015-72357 proposes calculating optical parametersto correct such unevenness in illuminance, and performing illuminancecorrection using the optical parameters.

BRIEF SUMMARY OF THE INVENTION

According to a first aspect of the invention, there is provided a focusdetection apparatus comprising: an imaging element that includes aplurality of focus detection pixels and that images a subject via animaging optical system; a correction value calculation unit thatcalculates a correction value based on an optical state, the correctionvalue being used to correct pixel signals output from the focusdetection pixels, the optical state being associated with light fluxesfrom the subject incident on the focus detection pixels; a correctionunit that corrects the pixel signals output from the focus detectionpixels using the correction value; and a focus detection unit thatperforms focus detection based on the corrected pixel signals, whereinthe correction value calculation unit calculates the correction valuebased on the optical state, the optical state is a state of before theimaging element performs imaging for still image capturing or imagingfor focus detection, and the correction unit performs correction usingthe correction value simultaneously with reading the pixel signals fromthe focus detection pixels subsequent to the imaging for the still imagecapturing or the imaging for the focus detection by the imaging element.

According to a second aspect of the invention, there is provided a focusdetection method comprising: causing an imaging element that includes aplurality of focus detection pixels to image a subject via an imagingoptical system; calculating a correction value based on an opticalstate, the correction value being used to correct pixel signals outputfrom the focus detection pixels, the optical state being associated withlight fluxes from the subject incident on the focus detection pixels;correcting the pixel signals output from the focus detection pixelsusing the correction value; and performing focus detection based on thecorrected pixel signals, wherein the calculating of the correction valueincludes calculating the correction value based on the optical state,the optical state is a state of before the imaging element performsimaging for still image capturing or imaging for focus detection, andthe correcting includes performing correction using the correction valuesimultaneously with reading the pixel signals from the focus detectionpixels subsequent to the imaging for the still image capturing or theimaging for the focus detection by the imaging element.

Advantages of the invention will be set forth in the description whichfollows, and in part will be obvious from the description, or may belearned by practice of the invention. The advantages of the inventionmay be realized and obtained by means of the instrumentalities andcombinations particularly pointed out hereinafter.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constituteapart of the specification, illustrate embodiments of the invention, andtogether with the general description given above and the detaileddescription of the embodiments given below, serve to explain theprinciples of the invention.

FIG. 1 is a block diagram showing an example of a configuration of animaging device that includes a focus detection apparatus, according toan embodiment of the present invention.

FIG. 2A is a flowchart showing an operation of the imaging deviceaccording to an embodiment of the present invention.

FIG. 2B is a flowchart showing an operation of the imaging deviceaccording to an embodiment of the present invention.

FIG. 3 is a schematic diagram showing an example of AF areas.

FIG. 4 is a diagram illustrating AF area selection processing when theAF mode is a single-target mode.

FIG. 5A is a diagram illustrating AF selection processing when the AFmode is a group-target mode.

FIG. 5B is a diagram illustrating AF selection processing when the AFmode is the group-target mode.

FIG. 6 is a diagram illustrating AF selection processing when the AFmode is an all-target mode.

FIG. 7 is a timing chart showing an operation after continuous exposureis started.

FIG. 8 is a timing chart showing an operation when live-view display ofa plurality of frames is performed during an interval between stillimage capturing.

FIG. 9 is a timing chart according to a modification in which an AEcomputation is performed using image data acquired by the latest imagingfor live-view display.

FIG. 10 is a timing chart according to a modification in which an AEcomputation is performed at a timing of driving a focus lens and anaperture.

FIG. 11 is a timing chart according to a modification in which an AEcomputation is performed at the timing of driving the focus lens and theaperture.

DETAILED DESCRIPTION OF THE INVENTION

Hereinafter, an embodiment of the present invention will be explainedwith reference to the accompanying drawings. FIG. 1 is a block diagramshowing an example of a configuration of an imaging device, whichincludes a focus detection apparatus, according to an embodiment of thepresent invention. In FIG. 1, solid lines with arrows indicate the flowof data, and broken lines with arrows indicate the flow of controlsignals.

As shown in FIG. 1, an imaging device 1 includes an interchangeable lens100 and a camera main body 200. The interchangeable lens 100 isconfigured to be detachable from the camera main body 200. When theinterchangeable lens 100 is attached to the camera main body 200, theyare communicably connected to each other. The imaging device 1 is notnecessarily a lens-exchangeable imaging device. For example, the imagingdevice 1 may be a lens-integrated imaging device.

The interchangeable lens 100 comprises an imaging optical system 102, adriver 104, a lens CPU 106, and a lens-side storage unit 108. Blocks ofthe interchangeable lens 100 are constituted by, for example, hardware.However, the blocks are not necessarily constituted by hardware, andsome of the blocks may be constituted by software. Also, each block ofthe interchangeable lens 100 does not need to be constituted by a singleitem of hardware or software, and may be constituted by a plurality ofitems of hardware or software.

The imaging optical system 102 is an optical system that forms lightfluxes from a subject into an image on an imaging element 208 of thecamera main body 200. The imaging optical system 102 includes a focuslens 1021 and an aperture 1022. The focus lens 1021 is configured tomove in an optical axis direction to adjust the focus position of theimaging optical system 102.

The aperture 1022 is disposed on the optical axis of the focus lens1021. The diameter of the aperture 1022 is variable. The aperture 1022adjusts the amount of light fluxes from a subject incident on theimaging element 208 after passing through the focus lens 1021. Thedriver 104 drives the focus lens 1021 and the aperture 1022 based oncontrol signals output from the lens CPU 106. The imaging optical system102 may be configured as a zoom lens. In this case, the driver 104 alsoperforms zoom driving.

The lens CPU 106 is configured to communicate with a CPU 218 of thecamera main body 200 via an interface (I/F) 110. The lens CPU 106controls the driver 104 in accordance with the control of the cameramain body 200 by the CPU 218. The lens CPU 106 sends information such asan aperture value (f-number) of the aperture 1022 and lens informationstored in the lens-side storage unit 108 to the CPU 218 via the I/F 110.The lens CPU 106 is not necessarily configured as a CPU. That is,functions similar to those of the lens CPU 106 may be implemented byASIC, FPGA, or the like. Furthermore, functions similar to those of thelens CPU 106 may be implemented by software.

The lens-side storage unit 108 stores lens information about theinterchangeable lens 100. The lens information includes, for example,information about the focal length of the imaging optical system 102 andinformation about aberration.

The camera main body 200 includes a mechanical shutter 202, a driver204, an operation unit 206, the imaging element 208, a camera shakecorrection circuit 210, an imaging control circuit 212, an analogprocessor 214, an analog-to-digital converter (ADC) 216, the CPU 218, animage processor 220, an image compression/expansion unit 222, a focusdetection circuit 224, an optical parameter calculation circuit 226, anilluminance correction circuit 228, an exposure control circuit 230, adisplay 232, a bus 234, a DRAM 236, a body-side storage unit 238, and arecording medium 240. Each block of the camera main body 200 isconstituted by, for example, hardware. However, the blocks of the cameramain body 200 are not necessarily constituted by hardware, and some ofthe blocks may be constituted by software. Also, each block of thecamera main body 200 does not need to be constituted by a single item ofhardware or software, and may be constituted by a plurality of items ofhardware or software.

The mechanical shutter 202 is configured to be openable and closable toadjust the period of time during which light fluxes from a subject isincident on the imaging element 208 (exposure time of the imagingelement 208). A focal-plane shutter, for example, may be employed as themechanical shutter 202. The driver 204 drives the mechanical shutter 202on the basis of a control signal from the CPU 218.

The operation unit 206 includes various operational buttons such as apower supply button, a release button, a movie button, a replay button,and a menu button, as well as various operational components such as atouch panel. The operation unit 206 detects the operational states ofthe various operational components and outputs signals indicative of thedetection results to the CPU 218.

The imaging element 208 is disposed at a position behind the mechanicalshutter 202 on the optical axis of the imaging optical system 102, wherethe imaging optical system 102 forms an image from light fluxes from thesubject. The imaging element 208 includes a light receiving surface witha two-dimensional array of pixels. Each pixel is constituted by, forexample, a photodiode, and generates an electric charge according to theamount of received light fluxes. The electric charges generated at thepixels are stored in capacitors connected to the respective pixels. Theelectric charges stored in the capacitors are read as pixel signals inaccordance with control signals from the imaging control circuit 212. Inthe present embodiment, the pixels include focus detection pixels. Eachof the focus detection pixels is a pixel configured to receive a lightflux from only one of a pair of pupil areas of the imaging opticalsystem 102. To receive a light flux from only one of the pair of pupilareas, each of the focus detection pixels is configured to light-shielda part of the area with a light-shielding film. Alternatively, each ofthe focus detection pixels may be configured in such a manner that alight flux from only one of the pair of pupil areas is received by thepupil division method that uses a microlens.

The camera shake correction circuit 210 moves the imaging element 208 ina direction parallel to its light receiving surface to prevent a camerashake that may occur in the camera main body 200. The movement of theimaging element 208 upon occurrence of a camera shake suppresses blur ofthe subject image that may be caused in image data by the camera shake.The camera shake correction circuit may be provided in theinterchangeable lens 100. In this case, the camera shake correctioncircuit is configured to move a camera shake correction optical systemincluded in the imaging optical system 102.

The imaging control circuit 212 controls imaging (exposure) of theimaging element 208 and reading of the pixel signals from the imagingelement 208, in accordance with the setting of reading the pixel signalsfrom the imaging element 208.

The analog processor 214 performs analog processing such asamplification processing on the pixel signals read from the imagingelement 208, in accordance with the control by the imaging controlcircuit 212.

The ADC 216 converts the pixel signals output from the analog processor214 into digital pixel data. In the explanation given below, a set ofpixel data will be referred to as image data.

The CPU 218 is a controller that performs control of the entire cameramain body 200 in accordance with a program stored in the body-sidestorage unit 238. The CPU 218 controls imaging by the imaging element208 via, for example, the imaging control circuit 212. In accordancewith the focus state of the focus lens 1021 detected by the focusdetection circuit 224, the CPU 218 outputs a control signal for drivingthe focus lens 1021 to the lens CPU 106. The CPU 218 outputs an exposuresetting value calculated by the exposure control circuit 230 to the lensCPU 106 and the imaging control circuit 212. The CPU 218 is notnecessarily configured as a CPU. That is, functions similar to those ofthe CPU 218 may be implemented by ASIC, FPGA, or the like. Furthermore,functions similar to those of the CPU 218 may be implemented bysoftware.

The image processor 220 performs various kinds of image processing onthe image data. To record still images, for example, the image processor220 performs image processing for still image recording. Similarly, torecord moving images, the image processor 220 performs image processingfor moving image recording. To perform live-view display, the imageprocessor 220 performs image processing for display.

In image data recording, the image compression/expansion unit 222compresses the image data (still image data or moving image data)generated by the image processor 220. In image data reproduction, theimage compression/expansion unit 220 expands the image data recorded inthe recording medium 240 in a compressed state.

The focus detection circuit 224 as a focus detection unit performs focusdetection of the focus lens 1021 by the known phase difference method,using the pixel data of the focus detection pixels of the imagingelement 208. The optical parameter calculation circuit 226 as acorrection value calculation unit is constituted by a DSP, for example,and performs an optical parameter computation to calculate, for example,an illuminance correction value for illuminance correction. Theilluminance correction circuit 228 as a correction unit performs anilluminance correction to pixel data acquired from the focus detectionpixels, in accordance with the illuminance correction value calculatedby the optical parameter calculation circuit 226. The focus detectioncircuit 224, the optical parameter calculation circuit 226, and theilluminance correction circuit 228 will be explained in detail later.

The exposure control circuit 230 as an exposure control unit calculatesan exposure setting value on the basis of pixel data (including focusdetection pixels) of the imaging element 208. The exposure setting valueincludes a stop size (aperture value) of the aperture 1022 and theexposure time (shutter speed) of the imaging element 208.

The display 232 is a display unit such as a liquid crystal display or anorganic EL display, and disposed at, for example, the back of the cameramain body 200. The display 232 displays images under the control of theCPU 218. The display 232 is used for live-view display, recorded imagedisplay, and the like.

The bus 234 is connected to the ADC 216, the CPU 218, the imageprocessor 220, the image compression/expansion unit 222, the focusdetection circuit 224, the optical parameter calculation circuit 226,the illuminance correction circuit 228, the exposure control circuit230, the display 232, the DRAM 236, the body-side storage unit 238, andthe recording medium 240, and functions as a transfer path fortransferring various data generated in these blocks.

The DRAM 236 is an electrically rewritable memory, and temporarilystores various kinds of data, such as image data output from the imagingelement 208, image data for recording, image data for display, andprocessed data in the CPU 218. An SDRAM may also be employed fortemporary storage.

The body-side storage unit 238 stores programs used in the CPU 218, andvarious types of data such as adjustment values of the camera main body200. The recording medium 240 is configured to be embedded in orinserted into the camera main body 200, and records the image data forrecording as an image file of a predetermined format. Each of the DRAM236, the body-side storage unit 238, and the recording medium 240 may beconstituted by a single memory or the like, or by a combination ofmultiple memories or the like.

Hereinafter, an operation of the imaging device 1 of the presentembodiment will be explained. FIGS. 2A and 2B are flowcharts showingoperations of the imaging device according to the present embodiment.The operations shown in FIGS. 2A and 2B are started when a power-onoperation of the imaging device 1 by the user is detected. Upondetection of the power-on operation, the CPU 218 determines whether ornot a first release switch of a release button is turned on at stepS101. The first release switch is a switch that is turned on in responseto, for example, a half-press operation of the release button by theuser. If it is determined at step S101 that the first release switch isturned on, the processing advances to step S105. If it is determined atstep S101 that the first release switch is not turned on, the processingadvances to step S102.

At step S102, the CPU 218 captures image data for live-view (LV)display. At this time, the CPU 218 outputs a control signal to thedriver 204 to make the mechanical shutter 202 fully open, and outputs acontrol signal to the lens CPU 106 to drive the aperture 1022 by apredetermined amount (e.g., open aperture). After that, the CPU 218outputs a control signal to the imaging control circuit 212 to allow theimaging element 208 to start imaging for live-view display. This imagingis performed, for example, for each pixel of a predetermined row of theimaging element 208. Whenever imaging for live-view display of apredetermined row is completed, the imaging control circuit 212 startsreading pixel signals from the imaging element 208. The read pixelsignals are converted into pixel data by the ADC 216, and then stored inthe DRAM 236.

At step S103, the CPU 218 performs live-view (LV) display. At this time,the CPU 218 causes the image processor 220 to generate image data fordisplay. In response thereto, the image processor 220 performscorrection processing on the pixel data from the focus detection pixels.This correction processing allows the pixel data from the focusdetection pixels to be used for live-view display in a manner similar tothe pixel data from other normal pixels. After this correctionprocessing, the image processor 220 performs other processing requiredfor generating image data for live-view display to generate image datafor display. The CPU 218 causes the display 232 to display live-view(LV) images based on the image data for display generated by the imageprocessor 220. After that, the processing advances to step S104.

At step S104, the CPU 218 causes the exposure control circuit 230 toperform an AE computation. In response thereto, the exposure controlcircuit 230 calculates an exposure setting value (aperture value) fromimage data stored in the DRAM 236 at step S102. The CPU 218 outputs thecalculated exposure setting value to the lens CPU 106. After that, theprocessing returns to step S101. As a result of the processing at stepS104, image data for the next live-view display is captured inaccordance with the exposure setting value calculated at step S104.

At step S105, the CPU 218 performs imaging and reading for autofocusing(AF) and live-view (LV) display. The CPU 218 outputs a control signal tothe imaging control circuit 212 to cause the imaging element 208 tostart imaging for autofocusing. The exposure time in imaging forautofocusing may be different from the exposure time in imaging forlive-view display. This imaging is performed, for example, for eachpixel of a predetermined row of the imaging element 208. Whenever theimaging for autofocusing of a predetermined row is completed, theimaging control circuit 212 starts reading pixel signals from theimaging element 208. In this case, the CPU 218 inputs the pixel data ofthe focus detection pixels stored in the DRAM 236 to the illuminancecorrection circuit 228. In response thereto, the illuminance correctioncircuit 228 performs an illuminance correction to the pixel data of thefocus detection pixels. An illuminance correction is performed by, forexample, multiplying each item of pixel data by an illuminancecorrection value calculated for each item of pixel data. Thisilluminance correction value is calculated by an optical parametercomputation by the optical parameter calculation circuit 226. An opticalparameter computation is a convolutional integral of incidence anglecharacteristics of the light rays passing through the imaging opticalsystem 102, which are information about the light fluxes from thesubject, and incidence angle characteristics of the imaging element 208.Optical parameters that determine the incidence angle characteristics ofthe light rays passing through the imaging optical system 102 and theincidence angle characteristics of the imaging element 208 includeparameters indicative of various optical states, such as the aperturevalue, the pupil position, the zoom state, and the focus lens position(state of the subject distance), which are specified in theinterchangeable lens 100, and the state of camera shake correction (anamount of movement from the initial position of the imaging element 208or the camera shake correction optical system), the image height, andthe AF detection direction, which are specified in the camera main body200. Since an optical parameter computation includes a convolutionalintegral, the optical parameter calculation circuit 226 should desirablybe constituted by a DSP. The pixel signals subjected to an illuminancecorrection are converted into pixel data at the ADC 216, and then storedin the DRAM 236. After completion of pixel signal reading forautofocusing, the CPU 218 outputs a control signal to the imagingcontrol circuit 212 to cause the imaging element 208 to start imagingfor live-view display. Whenever imaging for live-view display of apredetermined row is completed, the imaging control circuit 212 startsreading pixel signals from the imaging element 208. The read pixelsignals are converted into pixel data at the ADC 216, and then stored inthe DRAM 236.

At step S106, the CPU 218 performs live-view (LV) display, in a mannersimilar to step S103.

At step S107, the CPU 218 causes the exposure control circuit 230 toperform an AE computation. At step S107, an exposure setting value maybe calculated for each of imaging for autofocusing and imaging forlive-view display.

At step S108, the CPU 218 causes the focus detection circuit 224 toperform a focus detection computation. The focus detection circuit 224performs a correlation computation of a pair of focus detection pixels,using the pixel data of the focus detection pixels subjected to theilluminance correction and stored in the DRAM 236.

During the focus detection computation, the focus detection circuit 224evaluates the reliability of focus detection. In the present embodiment,a reliability evaluation is performed during the focus detectioncomputation, and a defocus amount computation is performed only on ahighly reliable AF area. It is thereby possible to improve the accuracyin focus adjustment and to reduce the computation load, while performingfocus detection at multiple points. Hereinafter, the reliabilityevaluation will be explained.

The focus detection circuit 224 performs a reliability evaluation on thebasis of correlation values obtained by the correlation computation.

FIG. 3 is a schematic diagram showing an example of AF areas. In theexample of FIG. 3, an AF area A0 includes 121 AF areas A1. Eleven AFareas A1 are disposed in each of the longitudinal and lateral directionsin the screen. In the present embodiment, a reliability evaluation isperformed for each of the 121 AF areas A1. Depending on the arraypattern of the focus detection pixels, focus detection may be performedin each of the two AF detection directions, namely, the longitudinal andlateral directions, for each AF area A1. In this case, reliabilityevaluation may be performed in the longitudinal and lateral directionsfor the 121 AF areas A1.

In the reliability evaluation, the following conditions (1)-(3) areevaluated. When an AF area satisfies all of the conditions (1)-(3), itis determined that the reliability of the AF area is high. After thereliability evaluation, the processing advances to step S109.

(1) Whether or not the contrast obtained from the pixel data of thefocus detection pixels is sufficiently high.

(2) Whether or not the local minimum value of correlation values issufficiently small.

(3) Whether or not a gradient of the local minimum value of thecorrelation values and a greater one of correlation values adjacent tothe local minimum value is sufficiently high (whether or not theperiphery of the local minimum value of the correlation values issharp-edged).

Herein, the conditions for the reliability evaluation are not limited tothe above-described three conditions, and other conditions may be added,or some of the three conditions may be omitted. A determination as towhether or not each AF area satisfies the conditions may be performed bycalculating, as numerical values, the extent to which the conditions aresatisfied. In this case, if the sum of the numerical values calculatedfor an AF area is large, for example, it is determined that thereliability of the AF area is high.

Reference will be made back to FIGS. 2A and 2B. At step S109, the focusdetection circuit 224 performs a defocus amount computation. That is,the focus detection circuit 224 calculates a defocus amount from thefocus position of the focus lens 1021, based on a spacing value betweentwo images in an AF area determined as being highly reliable (an imageshift amount corresponding to the extreme value of the correlationvalues) as a result of the reliability evaluation at step S108.Specifically, the focus detection circuit 224 calculates a defocusamount by multiplying the spacing value between two images by asensitivity value that is different according to the AF area and the AFdetection direction. The sensitivity value is calculated by an opticalparameter computation at the optical parameter calculation circuit 226,in a manner similar to the illuminance correction value, and is aconversion coefficient used to convert the spacing value between twoimages (an image phase difference amount) into a defocus amount. Aftercalculation of the defocus amount, the focus detection circuit 224 adds,to the defocus amount, a contrast shift correction value of the imagingoptical system 102 (approximately the frequency shift amount of theimaging optical system 102), which is a correction value that isdifferent according to the AF area. The focus detection circuit 224further performs a process of converting the defocus amount into a focuslens position (lens pulse position). After that, the processing advancesto step S110.

At step S110, the focus detection circuit 224 performs area selectionprocessing to select an AF area corresponding to the focus lens positionused to drive the focus lens 1021. After the area selection processing,the processing advances to step S111. The area selection processing isperformed by, for example, selecting an AF area indicative of a focuslens position corresponding to the shortest subject distance (i.e., theclosest focus lens position). Hereinafter, an example of the areaselection processing will be explained in brief.

FIG. 4 is a diagram illustrating AF area selection processing when theAF mode is a single-target mode. The single-target mode is a mode thatperforms autofocusing on an AF area A11 specified by the user, fromamong the 121 AF areas. That is, the AF area is selected in thesingle-target mode. Accordingly, in the single-target mode, an AFdirection indicative of a focus lens position corresponding to theshortest distance is selected from the AF directions in the specified AFarea A11.

FIGS. 5A and 5B are diagrams illustrating AF selection processing whenthe AF mode is a group-target mode. The group-target mode is a mode thatperforms autofocusing on a group of AF areas specified by the user, fromamong the 121 AF areas. Examples of this group include a rectangulargroup A12 constituted by nine AF areas shown in FIG. 5A, and across-shaped group A13 constituted by five AF areas shown in FIG. 5B. Inthe group-target mode, an AF area and an AF direction indicative of afocus lens position corresponding to the shortest distance are selectedfrom the specified group A12 or A13.

FIG. 6 is a diagram illustrating AF selection processing when the AFmode is an all-target mode. In the all-target mode, an AF area isselected with a high priority given to the center. Specifically, an AFarea is selected from an AF area A14 including 25 central AF areasenclosed by the heavy line in FIG. 6. If a plurality of highly reliableAF areas are present in the AF areas A14, an AF area and an AF directionindicative of a focus lens position corresponding to the shortestdistance are selected therefrom. If no AF areas in the AF areas A14 arehighly reliable, an AF area is selected from an AF area A15 including 49central AF areas enclosed by the heavy line in FIG. 6. If a plurality ofhighly reliable AF areas are present in the AF area A15, an AF area andan AF direction indicative of a focus lens position corresponding to theshortest distance are selected therefrom. If no AF areas in the AF areaA15 are highly reliable, an AF area is selected from another AF areaA16. If a plurality of highly reliable AF areas are present in the AFarea A16, an AF area and an AF direction indicative of a focus lensposition corresponding to the shortest distance are selected therefrom.

The area selection processing is not limited to the method of selectingan AF area indicative of the closest focus lens position. For example, amethod of selecting the most highly reliable AF area may be used as thearea selection processing. Furthermore, when area selection processingis performed after a moving object prediction computation, which will bedescribed later, a method of selecting an AF area indicative of a focuslens position according to the moving object prediction equation may beused.

Reference will be made back to FIGS. 2A and 2B. At step S111, the CPU218 determines whether or not the focus lens 1021 is in focus. Thedetermination at step S111 is performed by, for example, determiningwhether or not the defocus amount (difference between the current focuslens position and the selected focus lens position) in the AF areaselected in the area selection processing is within a predeterminedpermissible range. If the defocus amount is within the permissiblerange, it is determined that the focus lens 1021 is in focus. If it isdetermined at step S111 that the focus lens 1021 is out of focus, theprocessing advances to step S112. If it is determined at step S111 thatthe focus lens 1021 is in focus, the processing advances to step S113.

At step S112, the CPU 218 outputs a control signal to the lens CPU 106to drive the focus lens 1021 in accordance with the focus lens positioncalculated for the AF area selected at step S110. In response to thecontrol signal, the lens CPU 106 drives the focus lens 1021 via thedriver 104. After that, the processing returns to step S102.

At step S113, the CPU 218 determines, at step S113, whether or not thereis a change in the optical parameters. At step S113, if any of theoptical parameters such as the aperture value, the focus lens position,the zoom state, and the camera shake correction state has changed to anextent that affects the illuminance correction value, the sensitivityvalue, or the like, it is determined that there is a change in theoptical parameters. If it is determined at step S113 that there is achange in the optical parameters, the processing advances to step S114.If it is determined at step S113 that there is no change in the opticalparameters, the processing advances to step S115.

At step S114, the CPU 218 causes the optical parameter calculationcircuit 226 to perform an optical parameter computation. The processingat step S114 is performed at a predetermined timing that will beexplained later. Although not illustrated in FIG. 2A, the determinationabout the change in optical parameters at step S113 and the opticalparameter computation at step S114 may be performed during the focuslens driving at step S112, as will be described later.

The CPU 218 performs, at step S115, imaging and pixel signal reading forautofocusing, and imaging and pixel signal reading for live-view (LV)display, in a manner similar to step S105. At step S115, the pixelsignals of the focus detection pixels that are sequentially read inaccordance with the imaging for autofocusing are converted into pixeldata at the ADC 216 and input to the illuminance correction circuit 228.In response thereto, the illuminance correction circuit 228 performs anilluminance correction to the pixel data of the focus detection pixels.Thus, in the present embodiment, an illuminance correction is performedsimultaneously with the reading subsequent to the imaging forautofocusing.

At step S116, the CPU 218 causes the focus detection circuit 224 toperform a focus detection computation. In response thereto, the focusdetection circuit 224 performs a reliability evaluation in a mannersimilar to step S108. After that, at step S117, the focus detectioncircuit 224 performs a defocus amount computation, in a manner similarto step S109. At step S118, the focus detection circuit 224 performsarea selection processing similar to that of step S110.

At step S119, the CPU 218 causes the DRAM 236, for example, to storehistory information used for a moving object prediction computation. Thehistory information is, for example, a focus lens position (lens pulseposition) corresponding to the AF area selected in the area selectionprocessing. The number of focus lens positions stored as the historyinformation may be suitably set.

At step S120, the CPU 218 determines whether or not a second releaseswitch is turned on. The second release switch is a switch that isturned on in response to, for example, a full-press operation of therelease button by the user. If it is determined at step S120 that thesecond release switch is turned on, the processing advances to stepS123. If it is determined at step S120 that the second release switch isnot turned on, the processing advances to step S121.

At step S121, the CPU 218 determines whether or not the focus lens 1021is in focus, in a manner similar to step S111. If it is determined atstep S121 that the focus lens 1021 is out of focus, the processingadvances to step S122. If it is determined at step S121 that the focuslens 1021 is in focus, the processing returns to step S113.

At step S122, the CPU 218 outputs a control signal to the lens CPU 106in such a manner that the focus lens 1021 is driven in accordance withthe focus lens position calculated at step S117. In response to thecontrol signal, the lens CPU 106 drives the focus lens 1021 via thedriver 104. After that, the processing returns to step S113. Thedetermination about the change in optical parameters at step S113 andthe optical parameter computation at step S114 may be performed inparallel during the focus lens driving at step S122.

At step S123, the CPU 218 causes the focus detection circuit 224 toperform a moving object prediction computation. In response thereto, thefocus detection circuit 224 performs a moving object predictioncomputation. The moving object prediction computation is a process ofpredicting the next position at which the focus lens 1021 is to bedriven from the history of results (focus lens positions) of the pastdefocus amount computations.

At step S124, the CPU 218 starts operating the mechanical shutter 202 toperform imaging (main exposure) for still image capturing. Theoperations of the mechanical shutter 202 include an opening and closingoperation of the mechanical shutter 202 before and after the mainexposure, and a full-open operation of the mechanical shutter 202 tostart imaging for live view and imaging for autofocusing after the mainexposure. First, the CPU 218 switches the control signal of the driver204 to make the mechanical shutter 202 fully closed. After performingthe main exposure at step S126, the CPU 218 controls the driver 204 tomake the mechanical shutter 202 fully open.

At step S125, the CPU 218 instructs the lens CPU 106 to simultaneouslydrive the focus lens 1021 (driving of LD) and the aperture 1022 to startan operation. The driving position of the focus lens 1021 is theposition predicted by the moving object prediction computation at stepS123. The stop size of the aperture 1022 is a stop size corresponding tothe exposure setting value (aperture value) calculated by the latest AEcomputation.

At step S126, the CPU 218 starts main exposure. The main exposure isimaging to acquire image data for recording. In the main exposure, theCPU 218 controls the driver 204 to open and close the mechanical shutter202 only for a predetermined exposure period necessary for continuouslycapturing still images. The CPU 218 causes the imaging element 208 tostart imaging only for the exposure period. After the exposure periodends, the imaging control circuit 212 reads pixel signals from thepixels of the imaging element 208. After the pixel signal reading, theCPU 218 causes the image processor 220 to perform processing to generatestill image data for recording. In response thereto, the image processor220 performs correction processing on the pixel data from the focusdetection pixels. After the correction processing, the image processor220 performs other processing necessary for generating the image datafor recording to generate still image data for recording. Aftercompletion of the image processing, the CPU 218 causes the imagecompression/expansion unit 222 to compress the still image data forrecording. After completion of the compression, the CPU 218 records thecompressed still image data for recording as an image file in therecording medium 240. In the present embodiment, the pixel signals ofthe focus detection pixels are converted into pixel data at the ADC 216subsequently to the imaging for the main exposure, and then input to theilluminance correction circuit 228. In response thereto, the illuminancecorrection circuit 228 performs illuminance correction to the pixel dataof the focus detection pixels. Thus, in the present embodiment,illuminance correction is performed simultaneously with the pixel signalreading subsequent to the main exposure.

At step S127, the CPU 218 causes the exposure control circuit 230 toperform an AE computation. In response thereto, the exposure controlcircuit 230 calculates an exposure setting value (aperture value) fromthe image data stored in the DRAM 236 as a result of the main exposureof the last frame.

At step S128, the CPU 218 instructs the lens CPU 106 to drive theaperture 1022. The stop size of the aperture 1022 is a stop sizecorresponding to the exposure setting value (aperture value) calculatedby the latest AE computation. Driving of the aperture 1022 at step S128may be performed in parallel with the pixel signal reading subsequent tothe main exposure. Although not shown in FIG. 2B, after completion ofthe pixel signal reading subsequent to the main exposure, the distancemeasurement computation (i.e., the focus detection computation and thedefocus amount computation) is performed on the basis of the read pixelsignals of the focus detection pixels subjected to the illuminancecorrection. The focus lens position calculated by the distancemeasurement computation is saved as history information for the movingobject prediction computation.

At step S129, the CPU 218 determines whether or not the first releaseswitch is turned on, in a manner similar to step S101. If it isdetermined at step S129 that the first release switch is turned on, theprocessing returns to step S113. If it is determined at step S129 thatthe first release switch is not turned on, the processing advances tostep S130.

At step S130, the CPU 218 determines whether or not the camera main body200 should be powered off. For example, if the user gives a power-offinstruction by operating the operation unit 206, or if the user does notoperate the operation unit 206 for a predetermined period of time, it isdetermined that the camera main body 200 should be powered off. If it isdetermined at step S130 that the camera main body 200 should not bepowered off, the processing returns to step S101. If it is determined atstep S130 that the camera main body 200 should be powered off, theprocessing ends.

Herein, the optical parameter computation and the illuminance correctionwill be explained in more detail. FIG. 7 is a timing chart illustratingan operation after continuous exposure is started (after the secondrelease switch is turned on), according to the present embodiment. Fromthe top in FIG. 7, (a) shows the exposure period in each of the imagingfor the main exposure and autofocusing, and the imaging for live-viewdisplay, (b) shows the timing of start of exposure in each imaging, (c)shows the timing of pixel signal reading in each imaging, (d) shows thetiming of optical parameter computation, (e) shows the timing ofilluminance correction, (f) shows the timing of distance measurementcomputation (focus detection computation, defocus amount computation,and moving object prediction computation) and (g) shows the timing ofdriving the focus lens 1021 and the aperture 1022, and (h) shows thetiming of AE computation. The arrows in the drawing indicate processingin which the calculated information is used. In FIG. 7, driving of thefocus lens 1021 and the aperture 1022 and AE computation, prior to stillimage capturing (main exposure) of the first frame, are not shown.

As shown in FIG. 7, in a continuous-exposure mode, still images arecaptured every predetermined continuous-exposure interval while thesecond release switch is turned on. This continuous-exposure interval isdetermined by, for example, the number of continuous-exposure framesspecified by the user.

Whenever a still image is captured, the focus lens 1021 and the aperture1022 are driven in accordance with the results of the latest movingobject prediction computation and AE computation. The main exposure isperformed after completion of the driving of the focus lens 1021 and theaperture 1022. The main exposure is performed for a predetermined numberof rows (e.g., for each row) of the imaging element 208. Wheneverexposure of the predetermined row is completed, pixel signal reading isperformed. After the pixel signal reading is completed, still image datais recorded. After the recording of the still image data is completed,imaging for autofocusing and imaging for live-view display areperformed. Subsequently to the imaging for autofocusing and the imagingfor live-view display, pixel signal reading is performed, and distancemeasurement computation and live-view display are performed. After that,the focus lens 1021 and the aperture 1022 are driven to perform the mainexposure of the next frame.

When continuous exposure is started in this manner, the main exposureand the imaging for autofocusing and the imaging for live-view displayare alternately performed. Accordingly, optical parameters such as theaperture value and the camera shake correction state may vary frommoment to moment. When optical parameters have changed to an extent thataffects, for example, the illuminance correction value, the opticalparameter computation needs to be performed again. Since an opticalparameter computation includes a convolutional integral, an opticalparameter computation tends to be time-consuming, and may deterioratethe responsiveness in continuous exposure.

In the present embodiment, the optical parameter computation for thestill image capturing (main exposure) is performed at the timing (period(1) in FIG. 7) of driving the focus lens 1021 and the aperture 1022,immediately before the main exposure, which is before the start of thestill image capturing (main exposure) and after determination of theexposure setting value at the main exposure. If the illuminancecorrection value and the sensitivity value are calculated at thistiming, illuminance correction can be performed simultaneously with thepixel signal reading subsequent to the main exposure that follows, and adistance measurement computation can be performed upon completion of theilluminance correction. That is, it is possible to eliminate the periodof time during which only an optical parameter computation is performed,thus improving the responsiveness in continuous exposure.

In the present embodiment, an optical parameter computation forlive-view display is performed at the timing (period (2) in FIG. 7) ofthe pixel signal reading subsequent to the main exposure. If theilluminance correction value and the sensitivity value are calculated atthis timing, illuminance correction can be performed simultaneously withthe pixel signal reading subsequent to the imaging for autofocusing thatfollows, and a distance measurement computation can be performed uponcompletion of the illuminance correction. In this case as well, it ispossible to eliminate the period of time during which only an opticalparameter computation is performed, thus improving the responsiveness incontinuous exposure.

Furthermore, in the present embodiment, an AE computation is performedat the timing of the pixel signal reading subsequent to the mainexposure. In this AE computation, image data acquired as a result of themain exposure of the last frame is used. By reflecting the result ofthis AE computation in both the still image capturing (main exposure) ofthe next frame and the imaging for live view, it is possible to improvethe responsiveness in continuous exposure.

Next, optical parameters used in an optical parameter computation willbe explained. Optical parameters used in a continuous-exposure opticalparameter computation are basically the latest optical parameters at thetime of performance of the optical parameter computation. For example,the aperture value is calculated in an AE computation of a previousframe. The focus lens position is calculated in the last distancemeasurement computation. The zoom state is a zoom position at the timeof the optical parameter computation. The camera shake correction stateis an amount of movement of the imaging element 208 or the camera shakecorrection optical system from the initial position at the time of theoptical parameter computation.

Depending on the setting of the camera shake correction, initializationprocessing may be performed at a predetermined timing during continuousexposure. Initialization processing is processing to make the imagingelement 208 or the camera shake correction optical system return to apredetermined initial position, prior to camera shake correction, toensure a high accuracy of the camera shake correction. For example, itis desirable that initialization processing should be performedimmediately before the main exposure. On the other hand, initializationprocessing does not need to be performed in live-view display during aninterval between the main exposures, since performing initializationevery time would reduce the responsiveness. When initializationprocessing is performed, it is desirable that an optical parametercomputation should be performed, since the camera shake correction state(an amount of movement of the imaging element 208 or the camera shakecorrection optical system from the initial position) may greatly change.

In an optical parameter computation when camera shake correctioninitialization processing is performed, for example, for live-viewdisplay of the first frame immediately before or after the mainexposure, it is desirable to use, as information about the camera shakestate, information about the camera shake state at the time ofinitialization (i.e., zero amount of movement), instead of informationabout the latest camera shake state. Use of the latest information isnot desirable for the purpose of preventing an optical parametercomputation from being performed using information about the camerashake state during the initialization processing in the event of afailure in updating the information about the camera shake state. In anoptical parameter computation at a timing when initialization processingis performed, fixedly using information about the camera shake state atthe time of the initialization does not have much effect on the accuracyin the illuminance correction value or the sensitivity value.

Depending on the setting of the continuous-exposure interval, live-viewdisplay of a plurality of frames may be performed during an intervalbetween still image capturing, as shown in FIG. 8. Even when the settingis made to perform initialization processing, initialization processingis not performed for live-view display of the second and subsequentframes in most cases. In such cases, it is desirable to use informationabout the latest camera shake state as information about the camerashake state in an optical parameter computation.

If it is determined that there is a change in optical parameters, asshown in FIG. 8, it is desirable to perform an optical parametercomputation at that point in time. During the performance of an opticalparameter computation, it is desirable to not perform an illuminancecorrection or a distance measurement computation that follows, even ifit is the timing of pixel signal reading subsequent to imaging forautofocusing (the timings indicated by the cross marks in FIG. 8). Thisis for the purpose of suppressing a deterioration in accuracy of focusdetection as a result of the illuminance correction and the distancemeasurement computation that follows, in accordance with the opticalparameters that have not been changed.

As described above, according to the present embodiment, it is possibleto improve the responsiveness in continuous exposure without degradingthe performance in focus detection, by performing an optical parametercomputation at timings such as the timing of driving the focus lens 1021and the aperture 1022 immediately before the main exposure, which isbefore the start of the still image capturing (main exposure) and afterthe determination of the exposure setting value at the main exposure,and the timing of pixel signal reading subsequent to the main exposure.

In the present embodiment, it is possible to improve the responsivenessin continuous exposure by performing an AE computation at the timing ofpixel signal reading subsequent to the main exposure, when a distancemeasurement computation or the like is not performed, and reflecting theresults of the AE computation in both the still image capturing (mainexposure) of the next frame and the imaging for live view.

MODIFICATIONS

Hereinafter, modifications of the present embodiment will be explained.The modifications shown in FIGS. 9, 10, and 11 are modifications of theAE computation.

In the example shown in FIG. 7, an AE computation is performed usingimage data acquired by the main exposure of the last frame. However, anAE computation may be performed using image data acquired by the latestimaging for live-view display, as shown in FIG. 9. By performing an AEcomputation using image data acquired by the latest imaging forlive-view display, the AE computation can be performed using informationon a subject at a timing closer to the main exposure. It is therebypossible to improve the capability of tracking the subject in the AEcomputation.

In the example shown in FIG. 7, an AE computation is performed at thetiming of pixel signal reading subsequent to the main exposure. However,an AE computation may be performed at the timing of driving the focuslens 1021 and the aperture 1022, as shown in FIGS. 10 and 11. FIG. 10shows an example in which an AE computation is performed using theresults of the main exposure of the last frame, and FIG. 11 is anexample in which an AE computation is performed using image dataacquired by the latest imaging for live-view display. The timing ofdriving the focus lens 1021 and the aperture 1022 is also the timingwhen a distance measurement computation or the like is not performed. Byperforming an AE computation at this timing, it is possible to furtherimprove the responsiveness in continuous exposure.

In the above-described embodiment, an imaging device designed to recordimages of, for example, a digital camera is taken as an example.However, the technique of the present embodiment is applicable tovarious imaging devices comprising a focus lens, and may be applicableto imaging devices that do not necessarily record images. In thisrespect, the technique of the present embodiment is applicable toimaging devices such as an endoscope device, a microscopic device, and amonitoring device.

The processing of the above-described embodiment may be stored asprograms executable by the CPU 218, which is a computer. Alternatively,the processing may be stored in storage mediums of external storagedevices, such as a magnetic disk, an optical disk, and a semiconductormemory, and may be distributed. The CPU 218 reads the programs stored inthe storage medium of the external storage device, and executes theprocessing under the control of the read programs.

Additional advantages and modifications will readily occur to thoseskilled in the art. Therefore, the invention in its broader aspects isnot limited to the specific details and representative embodiments shownand described herein. Accordingly, various modifications may be madewithout departing from the spirit or scope of the general inventiveconcept as defined by the appended claims and their equivalents.

What is claimed is:
 1. A focus detection apparatus comprising: an imagesensor that includes a plurality of focus detection pixels and thatimages a subject via an imaging optical system; a correction valuecalculation circuit that calculates a correction value based on anoptical state, the correction value being used to correct pixel signalsoutput from the focus detection pixels, the optical state beingassociated with light fluxes from the subject incident on the focusdetection pixels; a luminance correction circuit that corrects the pixelsignals output from the focus detection pixels using the correctionvalue; and a focus detection circuit that performs focus detection basedon the corrected pixel signals, wherein the luminance correction circuitcalculates, when imaging for still image capturing is performed in acontinuous-exposure mode, the correction value based on the opticalstate during driving of a focus lens and an aperture immediately beforethe imaging for still image capturing by the image sensor, andcalculates, when imaging for focus detection is performed in thecontinuous-exposure mode, the correction value based on the opticalstate during reading of the pixel signals acquired in a previous imagingfor still image capturing, and the correction value calculation circuitperforms the correction using the correction value simultaneously withthe reading of the pixel signals from the focus detection pixelssubsequent to the imaging for the still image capturing and the imagingfor the focus detection.
 2. The focus detection apparatus according toclaim 1, wherein the optical state corresponds to a state of an aperturevalue in the imaging for the still image capturing, and the correctionvalue calculation circuit calculates the correction value based on theaperture value.
 3. The focus detection apparatus according to claim 2,further comprising an exposure control circuit that calculates anexposure setting value including the aperture value, the aperture valuebeing used in the imaging for the still image capturing based on pixelsignals acquired by imaging for still image capturing prior to currentstill image capturing, during reading of pixel signals acquired byimaging for the current still image capturing.
 4. The focus detectionapparatus according to claim 1, wherein the optical state corresponds toan amount of movement of the imaging optical system or the image sensorin camera shake correction, when the camera shake correction moves theimaging optical system or the image sensor, and the correction valuecalculation circuit calculates the correction value based on an amountof movement of the imaging optical system or the image sensor duringinitialization of the camera shake correction.
 5. The focus detectionapparatus according to claim 4, wherein the correction value calculationcircuit calculates the correction value, the correction value is used inimaging for focus detection performed subsequently to imaging forcurrent still image capturing, based on the amount of movement of theimaging optical system or the image sensor during the initialization. 6.The focus detection apparatus of claim 1 wherein the continuous-exposuremode includes repeatedly performing a sequence of still imaging,auto-focus imaging, live view display imaging.
 7. The focus detectionapparatus of claim 6 wherein the continuous-exposure mode furtherincludes repeatedly performing focus lens and aperture driving after theauto-focus imaging.
 8. A focus detection method comprising: causing animage sensor that includes a plurality of focus detection pixels toimage a subject via an imaging optical system; calculating a correctionvalue based on an optical state, the correction value being used tocorrect pixel signals output from the focus detection pixels, theoptical state being associated with light fluxes from the subjectincident on the focus detection pixels; correcting the pixel signalsoutput from the focus detection pixels using the correction value; andperforming focus detection based on the corrected pixel signals, whereinthe calculating of the correction value includes calculating, whenimaging for still image capturing is performed in a continuous-exposuremode, the correction value based on the optical state during driving ofa focus lens and an aperture immediately before imaging for still imagecapturing by the image sensor, and calculates, when imaging for focusdetection is performed in the continuous-exposure mode, the correctionvalue based on the optical state during reading of the pixel signalsacquired in a previous imaging for still image capturing, and thecorrecting includes performing the correction using the correction valuesimultaneously with the reading of the pixel signals from the focusdetection pixels subsequent to the imaging for the still image capturingand the imaging for the focus detection by the image sensor.
 9. Thefocus detection method of claim 8 wherein the continuous-exposure modeincludes repeatedly performing a sequence of still imaging, auto-focusimaging, live view display imaging.
 10. The focus detection method ofclaim 9 wherein the continuous-exposure mode further includes repeatedlyperforming focus lens and aperture driving after the auto-focus imaging.